package com.audaque.springboot.foshanupload.webfluxsecurity.service.impl;

import org.springframework.security.core.userdetails.ReactiveUserDetailsService;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

@Service
public class UserServiceImpl implements ReactiveUserDetailsService {
    @Override
    public Mono<UserDetails> findByUsername(String username) {
        UserDetails userDetails = User.withUsername("root")
                .password("admin").authorities("admin").build();
        // 构造出一个Mono
        Mono<UserDetails> just = Mono.just(userDetails);
        return just;
    }
}
